package com.tm.szb.commons;

import lombok.Data;

@Data
public class BizException extends RuntimeException{

    private int code;
    private String desc;

    public BizException(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public BizException(ResultEnums resultEnums) {
        this.code = resultEnums.getCode();
        this.desc = resultEnums.getMsg();
    }

    public BizException(String message, int code, String desc) {
        super(message);
        this.code = code;
        this.desc = desc;
    }

    public BizException(String message, Throwable cause, int code, String desc) {
        super(message, cause);
        this.code = code;
        this.desc = desc;
    }

    public BizException(Throwable cause, int code, String desc) {
        super(cause);
        this.code = code;
        this.desc = desc;
    }

    public BizException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, int code, String desc) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = code;
        this.desc = desc;
    }
}
